#include "syscall.h"

//The first 32 fibonacci numbers. 32 * 4 = 128 bytes, so it probably spans more
//than one page (unless I got _really_ lucky).
static unsigned int fib_val[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 
    233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368,
    75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309};

int calc_fib(unsigned int i) {
    if(i == 0) {
        return 0;
    }

    if(i == 1) {
        return 1;
    }

    return calc_fib(i - 2) + calc_fib(i - 1);
}

int main() {
    unsigned int i;
    for(i = 0; i < 1; i++) {
        if(Fork() == 0) {
            if(calc_fib(i) != fib_val[i]) {
                Exit(i);
            }
        }
    }
}
